Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform Version Checking #128

Merged
merged 22 commits into from
Jun 12, 2023
Merged

Terraform Version Checking #128

merged 22 commits into from
Jun 12, 2023

Conversation

SBGoods
Copy link
Contributor

@SBGoods SBGoods commented Jun 1, 2023

Implements Terraform Version Checking functionality as described in TF-643 that allows developers to create and use generic checks that check logic against the Terraform CLI Version to either skip or fail a test immediately before any test steps are run.

This PR:

  • Adds a new TerraformVersionChecks field to the TestCase struct
  • Modifies InitHelper() to retrieve the Terraform CLI version from tfexec
  • introduces a new tfversion package that exposes an interface for implementing custom version checks and contains built-in version checks
  • Updates website and package documentation

@SBGoods SBGoods requested a review from a team as a code owner June 1, 2023 21:49
@bflad bflad added this to the v1.3.0 milestone Jun 5, 2023
@bflad bflad added the enhancement New feature or request label Jun 5, 2023
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is looking real good, nice work!

tfversion/version_check.go Outdated Show resolved Hide resolved
tfversion/version_check.go Outdated Show resolved Hide resolved
tfversion/version_check.go Outdated Show resolved Hide resolved
tfversion/version_check.go Show resolved Hide resolved
website/docs/plugin/testing/acceptance-tests/testcase.mdx Outdated Show resolved Hide resolved
internal/plugintest/helper.go Outdated Show resolved Hide resolved
@SBGoods SBGoods requested a review from bflad June 12, 2023 18:09
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀 Nice work!

helper/resource/testing.go Outdated Show resolved Hide resolved
helper/resource/testing.go Outdated Show resolved Hide resolved
Co-authored-by: Brian Flad <bflad417@gmail.com>
@SBGoods SBGoods merged commit 38350df into main Jun 12, 2023
@SBGoods SBGoods deleted the version-checks branch June 12, 2023 20:08
@SBGoods SBGoods linked an issue Jun 13, 2023 that may be closed by this pull request
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SkipFunc and more helpful errors for Terraform versions during testing
2 participants